/****************************************************************************
* copyright            : (C) 2009 William Viana Soares <vianasw@gmail.com>  *
*****************************************************************************/

/****************************************************************************
*                                                                           *
*   This program is free software; you can redistribute it and/or modify    *
*   it under the terms of the GNU General Public License as published by    *
*   the Free Software Foundation; either version 2 of the License, or       *
*   (at your option) any later version.                                     *
*                                                                           *
*****************************************************************************/

#include "querymaker.h"
#include <iostream>
#include <cassert>

using namespace std;
using namespace ConciseQSR;

int main( int argc, char **argv )
{
    boost::asio::io_service io_service;
    QueryMaker qm( io_service, "localhost", argv[ 1 ] );
    
    string points( "( ( A 1 0 ) ( B 2 3 ) ( C 1 4 ) )" );
    string points2( "( ( B 2 3 ) ( A 1 0 )  ( C 1 4 ) )" );
    string points3( "( ( A 1 0 ) ( B 2 3 ) ( C 1 4 ) ( D 7 7 ) ( E 12 2 ) ( F 15 14 ) )" );
    assert( qm.qualifyPoints( points ) == "((A B 1_5 C) )" );
    assert( qm.qualifyPoints( points2 ) == "((B A 5_1 C) )" );
    assert( qm.computeInverse( "5_1" ) == "(1_5)" );
    assert( qm.computeHomming( "5_1" ) == "(5_3)" );
    cout << qm.qualifyPointsAll( points3 );
    return 0;
}